ctx_close isn't use anywhere, and free reallocate the GC array, which
is quite surprising and lead to memory leaking in xl.c
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
{
libxl_free_all(ctx);
free(ctx->alloc_ptrs);
- ctx->alloc_ptrs = calloc(ctx->alloc_maxsize, sizeof(void *));
- if (!ctx->alloc_ptrs)
- return ERROR_NOMEM;
- return 0;
-}
-
-int libxl_ctx_close(struct libxl_ctx *ctx)
-{
- libxl_ctx_free(ctx);
- free(ctx->alloc_ptrs);
xc_interface_close(ctx->xch);
xs_daemon_close(ctx->xsh);
return 0;
/* context functions */
int libxl_ctx_init(struct libxl_ctx *ctx);
int libxl_ctx_free(struct libxl_ctx *ctx);
-int libxl_ctx_close(struct libxl_ctx *ctx);
int libxl_ctx_set_log(struct libxl_ctx *ctx, libxl_log_callback log_callback, void *log_data);
/* domain related functions */